package com.example.orderfoodsystem22201310liuziming.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class aConfig implements WebMvcConfigurer{

    @Value("${dishphoto.url}")
    private String dishUrl;

    @Value("${dishphoto.dir}")
    private String dishDir;

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler(dishUrl+"**").addResourceLocations("file:"+dishDir);
    }
}
